/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      isLink：        是否超链接菜单，开启外链条件，`1、isLink: 链接地址不为空 2、isIframe:false`
 *      isHide：        是否隐藏此路由
 *      isKeepAlive：   是否缓存组件状态
 *      isAffix：       是否固定在 tagsView 栏上
 *      isIframe：      是否内嵌窗口，开启条件，`1、isIframe:true 2、isLink：链接地址不为空`
 *      roles：         当前路由权限标识，取角色管理。控制路由显示、隐藏。超级管理员：admin 普通角色：common
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */

/**
 * 定义动态路由
 * @description 未开启 isRequestRoutes 为 true 时使用（前端控制路由），开启时第一个顶级 children 的路由将被替换成接口请求回来的路由数据
 * @description 各字段请查看 `/@/views/system/menu/component/addMenu.vue 下的 ruleForm`
 * @returns 返回路由菜单数据
 */
export const dynamicRoutes = [
  {
    path: '/',
    name: '/',
    component: () => import('/@/layout/index.vue'),
    redirect: '/system',
    meta: {
      isKeepAlive: false,
    },
    children: [

      {
        path: '/dsProcess',
        name: 'dsProcess',
        component: () => import('/@/views/dsProcess/overview/index.vue'),
        redirect: '/dsProcess/overview',
        meta: {
          title: 'DS全流程',
          isLink: '',
          isHide: false,
          isKeepAlive: false,
          isAffix: false,
          isIframe: false,
          roles: ['admin'],
          icon: 'ele-SetUp',
        },
        children: [
          {
            path: '/dsProcess/overview',
            name: 'dsProcess-overview',
            component: () => import('/@/views/dsProcess/overview/index.vue'),
            meta: {
              title: '患者全览',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Postcard',
            },
            children: [
              {
                path: '/dsProcess/overview/patientDetail',
                name: 'dsProcess-overview-patientDetail',
                component: () => import('/@/views/dsProcess/overview/patientDetail.vue'),
                meta: {
                  title: '患者详情',
                  isLink: '',
                  isHide: true,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                },
              },
            ]
          },
          {
            path: '/dsProcess/notice',
            name: 'dsProcess-notice',
            component: () => import('/@/views/dsProcess/notice/patient.vue'),
            redirect: '/dsProcess/notice/patient',
            meta: {
              title: '通知发送',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Bell',
            },
            children: [
              {
                path: '/dsProcess/notice/patient',
                name: 'dsProcess-notice-patient',
                component: () => import('/@/views/dsProcess/notice/patient.vue'),
                meta: {
                  title: '通知患者',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                },
              },
              {
                path: '/dsProcess/notice/doctor',
                name: 'dsProcess-notice-doctor',
                component: () => import('/@/views/dsProcess/notice/doctor.vue'),
                meta: {
                  title: '通知医生',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                },
              },

            ]
          },
          {
            path: '/dsProcess/calendar',
            name: 'dsProcess-calendar',
            component: () => import('/@/views/dsProcess/calendar/index.vue'),
            meta: {
              title: '手术日程表',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Calendar',
            },
          },
        ],
      },
      {
        path: '/entryAndExit',
        name: 'entryAndExit',
        component: () => import('/@/views/entryAndExit/patientEntry/index.vue'),
        redirect: '/entryAndExit/patientEntry/index',
        meta: {
          title: '准入准出',
          isLink: '',
          isHide: false,
          isKeepAlive: false,
          isAffix: false,
          isIframe: false,
          roles: ['admin'],
          icon: 'ele-Sort',
        },
        children: [
          {
            path: '/entryAndExit/patientEntry/index',
            name: 'entryAndExit-patientEntry-index',
            component: () => import('/@/views/entryAndExit/patientEntry/index.vue'),
            meta: {
              title: '患者准入',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-User',
            },
          },
          {
            path: '/entryAndExit/doctorEntry/index',
            name: 'entryAndExit-doctorEntry-index',
            component: () => import('/@/views/entryAndExit/doctorEntry/index.vue'),
            meta: {
              title: '主刀医生准入',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Avatar',
            },
          },
          {
            path: '/entryAndExit/operationEntry/index',
            name: 'entryAndExit-operationEntry-index',
            component: () => import('/@/views/entryAndExit/operationEntry/index.vue'),
            meta: {
              title: '术式准入',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Connection',
            },
          },

        ]
      },
      {
        path: '/assessProcess',
        name: 'assessProcess',
        component: () => import('/@/views/assessProcess/narcosis/index.vue'),
        redirect: '/assessProcess/narcosis/index',
        meta: {
          title: '评估过程',
          isLink: '',
          isHide: false,
          isKeepAlive: false,
          isAffix: false,
          isIframe: false,
          roles: ['admin'],
          icon: 'ele-Operation',
        },
        children: [
          {
            path: '/assessProcess/narcosis/index',
            name: 'assessProcess-narcosis-index',
            component: () => import('/@/views/assessProcess/narcosis/index.vue'),
            meta: {
              title: '麻醉评估',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Filter',
            },
          },
          {
            path: '/assessProcess/leaveHospital/index',
            name: 'assessProcess-leaveHospital-index',
            component: () => import('/@/views/assessProcess/leaveHospital/index.vue'),
            meta: {
              title: '出院评估',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-OfficeBuilding',
            },
          },

        ]
      },
      {
        path: '/intelligentOutbound',
        name: 'intelligentOutbound',
        component: () => import('/@/views/intelligentOutbound/statistics/index.vue'),
        redirect: '/intelligentOutbound/statistics/index',
        meta: {
          title: '智能外呼',
          isLink: '',
          isHide: false,
          isKeepAlive: false,
          isAffix: false,
          isIframe: false,
          roles: ['admin'],
          icon: 'ele-Share',
        },
        children: [
          {
            path: '/intelligentOutbound/statistics/index',
            name: 'intelligentOutbound-statistics-index',
            component: () => import('/@/views/intelligentOutbound/statistics/index.vue'),
            meta: {
              title: '随访数据总览',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Histogram',
            },
          },
          {
            path: '/intelligentOutbound/intellect/index',
            name: 'intelligentOutbound-intellect-index',
            component: () => import('/@/views/intelligentOutbound/intellect/index.vue'),
            meta: {
              title: '智能随访',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-PhoneFilled',
            },
          },
          {
            path: '/intelligentOutbound/record',
            name: 'intelligentOutbound-record',
            component: () => import('/@/views/intelligentOutbound/record/index.vue'),
            meta: {
              title: '随访记录',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Film',
            },
            children: [
              {
                path: '/intelligentOutbound/record/recordDetail',
                name: 'intelligentOutbound-record-recordDetail',
                component: () => import('/@/views/intelligentOutbound/record/recordDetail.vue'),
                meta: {
                  title: '随访详情',
                  isLink: '',
                  isHide: true,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                },
              },
            ]
          },


        ]
      },
      {
        path: '/dataSync',
        name: 'dataSync',
        component: () => import('/@/views/dataSync/allData/index.vue'),
        redirect: '/dataSync/allData/index',
        meta: {
          title: '数据同步',
          isLink: '',
          isHide: false,
          isKeepAlive: false,
          isAffix: false,
          isIframe: false,
          roles: ['admin'],
          icon: 'ele-DocumentAdd',
        },
        children: [
          {
            path: '/dataSync/allData/index',
            name: 'dataSync-allData-index',
            component: () => import('/@/views/dataSync/allData/index.vue'),
            meta: {
              title: '数据全览',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Document',
            },
          },

        ]
      },
      {
        path: '/dataStatistics',
        name: 'dataStatistics',
        component: () => import('/@/views/dataStatistics/dashbord/index.vue'),
        redirect: '/dataStatistics/dashbord/index',
        meta: {
          title: '数据统计',
          isLink: '',
          isHide: false,
          isKeepAlive: false,
          isAffix: false,
          isIframe: false,
          roles: ['admin'],
          icon: 'ele-Histogram',
        },
        children: [
          {
            path: '/dataStatistics/dashbord/index',
            name: 'dataStatistics-dashbord-index',
            component: () => import('/@/views/dataStatistics/dashbord/index.vue'),
            meta: {
              title: '数据仪表盘',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Odometer',
            },
          },
          {
            path: '/dataStatistics/workload/index',
            name: 'dataStatistics-workload-index',
            component: () => import('/@/views/dataStatistics/workload/index.vue'),
            meta: {
              title: '工作量统计',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-HelpFilled',
            },
            children: [
              {
                path: '/dataStatistics/workload/index',
                name: 'dataStatistics-workload-index',
                component: () => import('/@/views/dataStatistics/workload/index.vue'),
                meta: {
                  title: '主刀医生工作量统计',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                  icon: '',
                },
              },
          ]
          },
          {
            path: '/dataStatistics/dataCenter',
            name: 'dataStatistics-dataCenter',
            component: () => import('/@/views/dataStatistics/dataCenter/appointment.vue'),
            redirect: '/dataStatistics/dataCenter/appointment',
            meta: {
              title: '中心运营数据',
              isLink: '',
              isHide: false,
              isKeepAlive: false,
              isAffix: false,
              isIframe: false,
              roles: ['admin'],
              icon: 'ele-Grid',
            },
            children: [
              {
                path: '/dataStatistics/dataCenter/appointment',
                name: 'dataStatistics-dataCenter-appointment',
                component: () => import('/@/views/dataStatistics/dataCenter/appointment.vue'),
                meta: {
                  title: '预约例数',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                  icon: '',
                },
              },
              {
                path: '/dataStatistics/dataCenter/finish',
                name: 'dataStatistics-dataCenter-finish',
                component: () => import('/@/views/dataStatistics/dataCenter/finish.vue'),
                meta: {
                  title: '完成例数',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                  icon: '',
                },
              },

              {
                path: '/dataStatistics/dataCenter/time',
                name: 'dataStatistics-dataCenter-time',
                component: () => import('/@/views/dataStatistics/dataCenter/time.vue'),
                meta: {
                  title: '日期占则期比',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                  icon: '',
                },
              },

              {
                path: '/dataStatistics/dataCenter/level',
                name: 'dataStatistics-dataCenter-level',
                component: () => import('/@/views/dataStatistics/dataCenter/level.vue'),
                meta: {
                  title: '三、四级手术占比',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                  icon: '',
                },
              },
              {
                path: '/dataStatistics/dataCenter/exit',
                name: 'dataStatistics-dataCenter-exit',
                component: () => import('/@/views/dataStatistics/dataCenter/exit.vue'),
                meta: {
                  title: '退出率',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                  icon: '',
                },
              },
              {
                path: '/dataStatistics/dataCenter/operateLevel',
                name: 'dataStatistics-dataCenter-operateLevel',
                component: () => import('/@/views/dataStatistics/dataCenter/operateLevel.vue'),
                meta: {
                  title: '手术级别分布',
                  isLink: '',
                  isHide: false,
                  isKeepAlive: false,
                  isAffix: false,
                  isIframe: false,
                  roles: ['admin'],
                  icon: '',
                },
              },

            ]
          },

        ]
      },
      {
        path: '/link',
        name: 'layoutLinkView',
        component: () => import('/@/layout/routerView/link.vue'),
        meta: {
          title: '使用帮助',
          isLink: 'https://element-plus.gitee.io/#/zh-CN/component/installation',
          isHide: false,
          isKeepAlive: false,
          isAffix: false,
          isIframe: false,
          roles: ['admin'],
          icon: 'iconfont icon-caozuo-wailian',
        },
      },

      {
      	path: '/system',
      	name: 'system',
      	component: () => import('/@/layout/routerView/parent.vue'),
      	redirect: '/system/user',
      	meta: {
      		title: '系统设置',
      		isLink: '',
      		isHide: false,
      		isKeepAlive: false,
      		isAffix: false,
      		isIframe: false,
      		roles: ['admin'],
      		icon: 'iconfont icon-xitongshezhi',
      	},
      	children: [
      		{
      			path: '/system/user',
      			name: 'systemUser',
      			component: () => import('/@/views/system/user/index.vue'),
      			meta: {
      				title: '用户管理',
      				isLink: '',
      				isHide: false,
      				isKeepAlive: false,
      				isAffix: false,
      				isIframe: false,
      				roles: ['admin'],
      				icon: 'iconfont icon-icon-',
      			},
      		},
          {
      			path: '/system/role',
      			name: 'systemRole',
      			component: () => import('/@/views/system/role/index.vue'),
      			meta: {
      				title: '用户角色对应',
      				isLink: '',
      				isHide: false,
      				isKeepAlive: false,
      				isAffix: false,
      				isIframe: false,
      				roles: ['admin'],
      				icon: 'ele-SetUp',
      			},
      		},
      		{
      			path: '/system/dept',
      			name: 'systemDept',
      			component: () => import('/@/views/system/dept/index.vue'),
      			meta: {
      				title: '角色菜单对应',
      				isLink: '',
      				isHide: false,
      				isKeepAlive: false,
      				isAffix: false,
      				isIframe: false,
      				roles: ['admin'],
      				icon: 'ele-OfficeBuilding',
      			},
      		},

      	],
      },

    ],
  },

];

/**
 * 定义404、401界面
 * @link 参考：https://next.router.vuejs.org/zh/guide/essentials/history-mode.html#netlify
 */
export const notFoundAndNoPower = [
  {
    path: '/:path(.*)*',
    name: 'notFound',
    component: () => import('/@/views/error/404.vue'),
    meta: {
      title: '页面找不到',
      isHide: true,
    },
  },
  {
    path: '/401',
    name: 'noPower',
    component: () => import('/@/views/error/401.vue'),
    meta: {
      title: '页面无权限',
      isHide: true,
    },
  },
];

/**
 * 定义静态路由（默认路由）
 * 此路由不要动，前端添加路由的话，请在 `dynamicRoutes 数组` 中添加
 * @description 前端控制直接改 dynamicRoutes 中的路由，后端控制不需要修改，请求接口路由数据时，会覆盖 dynamicRoutes 第一个顶级 children 的内容（全屏，不包含 layout 中的路由出口）
 * @returns 返回路由菜单数据
 */
export const staticRoutes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('/@/views/login/index.vue'),
    meta: {
      title: '登录',
    },
  },
];
